<template>
    <div>
      <div class="block">
        <span class="demonstration">三级下拉</span>
        <el-cascader
          v-model="value"
          :options="typeList"
          :props="{label:'typeName',value:'typeId'}"
        ></el-cascader>
      </div>
    </div>
</template>

<script>

import { listType } from "@/api/product/type";

export default {
  name: 'Index',
  data() {
    return {
      // 类型表格数据
      typeList: [],
      value: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    /** 查询类型列表 */
    getList() {
      this.loading = true;
      listType(this.queryParams).then(response => {
        this.typeList = this.handleTree(response.data, "typeId", "parentId");
        this.loading = false;
      });
    }
  }
}
</script>

<style scoped>

</style>
